﻿using System;
using System.Collections.Generic;
using System.Text; 

namespace NORM.Entity
{
    public class TableField
    {
        private string _field = string.Empty;
        public string Field
        {
            get { return _field; }
            set { _field = value; }
        }

        private Type _fieldtype;
        public Type FieldType
        {
            get { return _fieldtype; }
            set { _fieldtype = value; }
        }

        private object _fieldvalue;
        public object FieldValue
        {
            set
            {                
                if (value != null)
                {
                    _fieldtype = value.GetType();
                }
                _fieldvalue = value;
            }
            get { return _fieldvalue; }
        }

        private EntityBase _entity;
        public EntityBase Entity
        {
            get { return _entity; }
            set { _entity = value; }
        }

        public TableField()
        {           
            this.Entity = new EntityBase();
        }

        public override string ToString()
        {
            return this.Entity.TableName + "." + this.Field;
        }


    }
}
